#!/usr/bin/python
# -*-coding: utf-8 -*-
import db

class Dbconnect():
    def __init__(self,host,user,passwd):
        if not hasattr(self,'_instance'):
            self._instance = self.dbintit(host,user,passwd)
        return self._instance

    def dbintit(self,host,user,passwd):
        self._instance = db.DictMySQL(host='localhost',user='root',passwd='')

one = Dbconnect(host='localhost', user='root', passwd='')
print one
two = Dbconnect()
print two